#pragma once

#include <stdlib.h>
#include "ISymtable.h"
#include "StringtabV0.h"
#include "Helper.h"


class SymtabEntry
{
    Information info;
    SymtabEntry* prev;

public:
    SymtabEntry(Information info);
    ~SymtabEntry();

    void setPrev(SymtabEntry* prev);
    Information getInfo();
    void setInfo(Information info);
};

class SymtableV0 : public ISymtable
{
//private: vars
    IStringTab* tab;
    SymtabEntry** map;
    int* entriesPerHash;
    char lastChar;

public://vars
    static const size_t HASH_CNT;

	SymtableV0();
	virtual ~SymtableV0();

    virtual Hash calculateHash(Lexem lexem);
    
    //inheritance from ISymtable
    virtual void        putChar(char c);
    virtual Key         mkToken(TType type);
    virtual Information lookup(Key key);
    //inheritance from ISymtable from clgr
    virtual int         unputCharsAndGetAsInt();
    virtual char        unputAndGetChar();
};
